<extend name="Index:base" />
<block name="title"><title>{$title}</title></block>
<block name="style2">
<link href="__PUBLIC__/Home/css/base.css" rel="stylesheet" type="text/css">	
<link href="__PUBLIC__/Home/css/home_header.css" rel="stylesheet" type="text/css">	
<!-- <link href="__PUBLIC__/Home/css/zzsc.css" type="text/css" rel="stylesheet"> -->
<link href="__PUBLIC__/Home/css/magiczoomplus.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="__PUBLIC__/Home/js/mzp-packed.js"></script>

</block>	

 <block name="body">

<div class="nch-breadcrumb-layout">
    <div class="nch-breadcrumb wrapper"><i class="icon-home"></i>
            <span><a href="/">首页</a></span><span class="arrow">></span>
                <span>{$title}</span>
          </div>
  </div>
<style type="text/css">
#box { background: #FFF; width: 238px; height: 410px; margin: -390px 0 0 0; display: block; border: solid 4px #E4393C; position: absolute; z-index: 999; opacity: .5 }
#infscr-loading { display: none; }
</style>
<link href="__PUBLIC__/Home/css/layout.css" rel="stylesheet" type="text/css">

<div class="nch-container wrapper">
  <div class="ncp-category">
	  <ul>		
			<input type="hidden" id="sc_id" value="">
			<li><a class="selected" href="">所有分类</a></li>
			<foreach name="gc_list" item="vo">
            <li><a class="" href="/shop/fenlei.html?gc_name={$vo.gc_name}">{$vo.gc_name}</a></li>
			</foreach>
      </ul>
  </div>
  <div id="promotionGoods">
 <foreach name="goods_list" item="vo">   
<div class="item">
  <div class="scope">
    <dl class="goods">
      <dt class="goods-thumb"> <a title="{$vo.productname}" target="_blank" href="/shop/goods.html?gid={$vo.id}"><img src="{$vo.minpic}" /></a> </dt>
      <dd class="goods-name"><span><strong>好活动</strong></span> <a target="_blank" href="/shop/goods.html?gid={$vo.id}">{$vo.productname}</a></dd>
    </dl>
    <div class="goods-price"><span class="sale">{$vo.pay_name}<em>{$vo.m_html}</em></span><span class="depreciate"><i class="icon-long-arrow-down"></i>直降：{$vo.j_price|=number_format(###,2)}</span></div>
    <div class="goods-buy"><a href="/shop/goods.html?gid={$vo.id}" nctype="add_cart" data-gid="100078" class="btn">立即抢购</a> <span class="raty" data-score="5" style="width: 100px;"></span> <span class="mt5"><a href="/shop/show_store.html?stid={$vo.st_id}" target="_blank">{$vo.store_name}</a></span> </div>
    <ul class="goodseval">
          </ul>
  </div>
</div>
</foreach>

  </div>
  
 	<div class="pagination">
		<ul id="pagination">
			{$page}
		</ul>
	</div> 
  <div class="tc mt20 mb20">
    <div class="pagination" id="page-nav"></div>
  </div>
</div>
<div id="page-more"><a href=""></a></div>
<!-- <script type="text/javascript" src="__PUBLIC__/Home/js/jquery.raty/jquery.raty.min.js"></script>  -->
<script src="__PUBLIC__/Home/js/jquery.masonry.js" type="text/javascript"></script> 
<script src="__PUBLIC__/Home/js/jquery.infinitescroll.js" type="text/javascript"></script>
<!-- <script type="text/javascript" src="__PUBLIC__/Home/js/fly/jquery.fly.min.js" charset="utf-8"></script>  -->
<!--[if lt IE 10]>
<script type="text/javascript" src="js/fly/requestAnimationFrame.js" charset="utf-8"></script>
<![endif]-->
<script>
var $container = $('#promotionGoods');
$container.masonry({
    columnWidth: 305,
    itemSelector: '.item'
});
$(function(){
	/*$container.infinitescroll({  
        navSelector : '#page-more',
        nextSelector : '#page-more a',
        itemSelector : '.item',
        loading: {
        	selector:'#page-nav',
            img: '__PUBLIC__/Home/images/loading.gif',
            msgText:'努力加载中...',
            maxPage : 2,
            finishedMsg : '没有记录了',
            finished : function() {
            	$('.raty').raty({
                    path: "js/jquery.raty/img",
                    readOnly: true,
                    width: 100,
                    score: function() {
                      return $(this).attr('data-score');
                    }
                });
            }
        }
    },function(newElements){
		var $newElems = $(newElements);
		$container.masonry('appended', $newElems, true);
	});

	$('.raty').raty({
        path: "js/jquery.raty/img",
        readOnly: true,
        width: 100,
        score: function() {
          return $(this).attr('data-score');
        }
    });*/
    // 加入购物车
    $(window).resize(function() {
        $('#promotionGoods').on('click', 'a[nctype="add_cart"]', function() {
            flyToCart($(this));
        });
    });
    $('#promotionGoods').on('click', 'a[nctype="add_cart"]', function() {
        flyToCart($(this));
    });
     function flyToCart($this) {
        var rtoolbar_offset_left = $("#rtoolbar_cart").offset().left;
        var rtoolbar_offset_top = $("#rtoolbar_cart").offset().top-$(document).scrollTop();
        var img = $this.parents('.scope:first').find('img:first').attr('src');
        var data_gid = $this.attr('data-gid');
        var flyer = $('<img class="u-flyer" src="'+img+'" style="z-index:999">');
        flyer.fly({
            start: {
                left: $this.offset().left,
                top: $this.offset().top-$(document).scrollTop()-450
            },
            end: {
                left: rtoolbar_offset_left,
                top: rtoolbar_offset_top,
                width: 0,
                height: 0
            },
            onEnd: function(){
                addcart(data_gid,1,'');
                flyer.remove();
            }
        });
     }
});
</script> 
<link href="__PUBLIC__/Home/css/chat.css" rel="stylesheet" type="text/css">
                    <div style="clear: both;"></div>
                    <div id="web_chat_dialog" style="display: none;float:right;">
                    </div>
                    <a id="chat_login" href="javascript:void(0)" style="display: none;"></a>
                    <script type="text/javascript">
					//console.log(window.location.host);
					var host = window.location.host;
                    var LOGIN_SITE_URL = host+'/shop';
                    var CHAT_SITE_URL = host+'/shop';
                    var SHOP_SITE_URL = host+'/shop';
                    var connect_url = host+"/shop";

                    var layout = "layout/home_layout.php";
                    var act_op = "promotion_index";
                    var chat_goods_id = "0";
                    var user = {};

                    user['u_id'] = "";
                    user['u_name'] = "";
                    user['s_id'] = "";
                    user['s_name'] = "";
                    user['s_avatar'] = "";
                    user['avatar'] = "";

                    $("#chat_login").nc_login({
                      nchash:'96e3adbc',
                      formhash:'FN0RgFo8lBn3tzdkDujG9IaFI8rA3Po'
                    });
                    </script>
<script type="text/javascript" src="__PUBLIC__/Home/js/jquery.charCount.js" charset="utf-8"></script><script type="text/javascript" src="__PUBLIC__/Home/js/jquery.smilies.js" charset="utf-8"></script><script type="text/javascript" src="__PUBLIC__/Home/js/user.js" charset="utf-8"></script>
<script language="javascript">
function fade(){$("img[rel='lazy']").each(function(){var $scroTop=$(this).offset();if($scroTop.top<=$(window).scrollTop()+$(window).height()){$(this).hide();$(this).attr("src",$(this).attr("data-url"));$(this).removeAttr("rel");$(this).removeAttr("name");$(this).fadeIn(500)}})}if($("img[rel='lazy']").length>0){$(window).scroll(function(){fade()})}fade();

</script>


 </block>	
